# -*- coding: utf-8 -*-
# Author: xiantingDeng
# File: execute.py
# Time: 16:55


from common.element.elements import PocoElement
from common.util.api_util import get_yaml_data
from common.element.keyboard import TheKeyboard
from pages.transaction.handler import TransactionHandler


class TransitionBiz():
    def __init__(self, poco, log):
        self.__log = log
        self.__poco = PocoElement(poco, log)
        self.handler = TransactionHandler(poco, log)
        self.page = get_yaml_data("transaction.yaml")
        self.keyboard = TheKeyboard(poco, log)


    def transaction(self,money):
        self.__poco.click_on_the_element(self.handler.get_shuakashoukuan())
        self.__poco.click_on_the_element(self.handler.get_shoukuanjine())
        self.keyboard.the_input_keyevent(money)
        self.__poco.click_on_the_element(self.handler.get_querenshoukuan())